<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head>
    <meta charset="UTF-8">
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <meta name="csrf-token" th:content="${_csrf.token}" />
    <title>Tipask管理后台</title>

    <!-- jQuery 2.1.3 -->
    <script type="text/javascript" th:src="@{/static/js/jquery.min.js}"></script>
    <!-- Bootstrap 3.3.2 -->
    <link th:href="@{/static/css/bootstrap/css/bootstrap.min.css}"  rel="stylesheet" type="text/css" />
    <link th:href="@{/static/css/icheck/all.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/static/js/scojs/sco.message.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/static/js/daterangepicker/daterangepicker-bs3.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/static/js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css}" rel="stylesheet" type="text/css" />
    <!-- Font Awesome Icons -->
    <link th:href="@{/static/css/font-awesome/css/font-awesome.min.css}" rel="stylesheet" type="text/css" />

    <!-- Theme style -->
    <link th:href="@{/css/admin/admin.css}" rel="stylesheet" type="text/css" />
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link th:href="@{/css/admin/skins/_all-skins.min.css}" rel="stylesheet" type="text/css" />

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script th:src="@{/static/js/html5shiv.min.js}"></script>
    <script th:src="@{/static/js/respond.min.js}"></script>
    <![endif]-->

    <style type="text/css">
        .radio label {
            margin-right: 10px;
        }
    </style>
</head>
<body class="skin-blue sidebar-mini">
<div class="wrapper">
    <header class="main-header">
        <!-- Logo -->

        <div class="logo">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-mini"><b>T</b></span>
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg text-center">
                <a class="navbar-brand admin_logo" href="/admin/index"></a>
            </span>

        </div>

        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top" role="navigation">
            <!-- Sidebar toggle button-->
            <a href="#" class="sidebar-toggle" id="sliderbar_control"  data-toggle="offcanvas" role="button">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <!-- Notifications: style can be found in dropdown.less -->
                    <li class="dropdown notifications-menu">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="fa fa-bell-o"></i>
                            <span class="label label-warning" >3</span>
                        </a>
                        <ul class="dropdown-menu">
                            <li class="header">共有 {{ array_sum($notVerifiedData) }} 个待处理事项</li>
                            <li>
                                <!-- inner menu: contains the actual data -->
                                @if(array_sum($notVerifiedData)>0)
                                <ul class="menu">
                                    @if( $notVerifiedData['questions'] > 0 )
                                    <li>
                                        <a href="{{ route('admin.question.index') }}?status=0">
                                            <i class="fa fa-question-circle text-yellow"></i> {{ $notVerifiedData['questions'] }} 个问题需要审核
                                        </a>
                                    </li>
                                    @endif
                                    @if( $notVerifiedData['answers'] > 0  )
                                    <li>
                                        <a href="{{ route('admin.answer.index') }}?status=0">
                                            <i class="fa fa-comment-o text-yellow"></i> {{ $notVerifiedData['answers'] }} 个回答需要审核
                                        </a>
                                    </li>
                                    @endif
                                    @if( $notVerifiedData['articles'] > 0  )
                                    <li>
                                        <a href="{{ route('admin.article.index') }}?status=0">
                                            <i class="fa fa-book text-yellow"></i> {{ $notVerifiedData['articles'] }} 篇文章需要审核
                                        </a>
                                    </li>
                                    @endif
                                    @if( $notVerifiedData['comments'] > 0  )
                                    <li>
                                        <a href="{{ route('admin.comment.index') }}?status=0">
                                            <i class="fa fa-comments-o text-yellow"></i> {{ $notVerifiedData['comments'] }} 个评论需要审核
                                        </a>
                                    </li>
                                    @endif
                                </ul>
                                @endif
                            </li>
                        </ul>
                    </li>
                    <!-- User Account: style can be found in dropdown.less -->
                    <li class="dropdown user user-menu">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <span class="hidden-xs" th:text="${session.SPRING_SECURITY_CONTEXT.getAuthentication().getPrincipal()}"></span>
                        </a>
                        <ul class="dropdown-menu">
                            <!-- User image -->
                            <li class="user-header">
                                <img th:src="${currentUser.avatar}!=''?${currentUser.avatar}:'/static/images/default_avatar.jpg'" class="img-circle" alt="User Image" />
                                <p >
                                    <span th:text="${currentUser.nickname}"> </span>
                                    <small th:text="${currentUser.detail.title}"></small>
                                </p>
                            </li>
                            <!-- Menu Footer-->
                            <li class="user-footer">
                                <div class="pull-left">
                                    <a href="#" class="btn btn-default btn-flat">修改密码</a>
                                </div>
                                <div class="pull-right">
                                    <a href="javascript:void(0)" onclick="logout('/admin')"  class="btn btn-default btn-flat">退出登录</a>
                                </div>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </nav>
    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar" th:include="admin/public/menu">

        </section>
        <!-- /.sidebar -->



    </aside>

    <!-- Content Wrapper. Contains page content -->
    <div layout:fragment="content" class="content-wrapper">


    </div><!-- /.content-wrapper -->

<div th:include="admin/public/footer"/>

</div><!-- ./wrapper -->

<!--scripts-->
<div th:include="admin/public/script"/>

</body>
</html>
